1. Field of the Invention
The present invention relates to a three-dimensional measurement apparatus that is operable according to a spatial coding method, a three-dimensional measurement method, and a computer-readable medium storing a program that can control the apparatus and/or implement the method.
2. Description of the Related Art
Three-dimensional (3D) measurement of shapes has been an important field of research in many fields, such as computer vision for mixed reality (MR) systems, object recognition and image guided surgery (IGS), among others. 3D measurement of shapes includes shape reconstruction techniques, such as stereo vision structured light, and coded light projection, among others. A conventionally known pattern projection method includes projecting a plurality of patterns of light onto an object, capturing an image of the pattern of light projected on the object, and measuring a shape of the object based on a modulation of the pattern using the principle of triangulation. For example, a spatial coding method includes projecting onto an object stripe pattern light, which includes brighter and darker areas alternately disposed at arbitrary intervals, and binary coding a space, which is usable for the three-dimensional measurement of a shape of the object. A product employing the spatial coding method is commercially available. To improve the accuracy in the three-dimensional measurement of shapes according to the spatial coding method, accurately determining a boundary position between neighboring brighter and darker areas of the stripped pattern based on obtained image data is required.
However, in an actual measurement, it is generally difficult to remove adverse influences that may be caused by the reflectance of an object as well as adverse influences by external light (light other than the projected light). As a result, the luminance value does not change steeply in the vicinity of the boundary (see FIG. 10B). In other words, the boundary position cannot be precisely determined. In this case, a captured image includes a gray area at the boundary position between the brighter and darker areas. The gray area remains as a non-separable area.
In this field of endeavor, Japanese Patent Application Laid-Open No. 2008-32608 has proposed a method for accurately determining a boundary position and separating a brighter area and a darker area at the boundary position. For example, if stripe pattern light 110 illustrated in FIG. 11A is projected on an object 111 as illustrated in FIG. 11B, an area 112 in which the brighter area and the darker area are not separated may appear at an upper portion of the object 111 due to various influences, such as the reflectance of the object 111.
FIG. 11C illustrates a pattern when the area 112 is represented by the projected stripe pattern light 110. The method discussed in Japanese Patent Application Laid-Open No. 2008-32608 partly adjusts the quantity of projected light in an area 113 as illustrated in FIG. 11C, and generates partly corrected stripe pattern light as illustrated in FIG. 11D when the stripe pattern light is projected. As described above, neighboring brighter and darker areas can be clearly separated at each boundary position in an image of an object.
A measurement method discussed in Japanese Patent Application Laid-Open No. 2008-145139 includes shifting, by a predetermined cycle, stripe pattern light that has a brighter area and a darker area minimized in width, when a plurality of types of the stripe pattern light is projected. In this manner, the measurement density can be increased.
According to the method discussed in Japanese Patent Application Laid-Open No. 2008-32608, this measuring technique can separate the brighter area and the darker area if the measurement is influenced by the reflectance of an object or external light. However, this measuring technique is not employable in an event that reflected light gets blurred.
Specifically, the influences by the reflectance of an object and external light are dependent on the magnitude in luminance value when the projected light is reflected by an object. Thus, if the light quantity of the projection light is adjusted to minimize reflection, these influences can be reduced. However, the cause of the blur is the diffusion of light on an object surface that becomes larger compared to the in-focus position and the luminance value of the reflected light from the object becomes smaller. Therefore, separation of the boundary position is difficult if the light quantity of the projection light is adjusted to minimize the effects of reflection.
Similarly, the blur of the reflected light is not taken into consideration in the measurement method discussed in Japanese Patent Application Laid-Open No. 2008-145139. Therefore, conventional techniques for measuring 3D shapes are not employable if the stripe pattern light that has a brighter area and a darker area minimized in width cannot be separated at the boundary position due to the influences of blurred reflected light.